package ghostcat.algorithm.traversal
{
    import flash.geom.Point;
    
    import ghostcat.util.core.*;

    public class Traversal extends Object
    {
        public var maxTry:int;
        protected var openList:Array;
        protected var mapModel:IMapModel;

        public function Traversal(param1:MapModel, param2:int = 5000)
        {
            AbstractUtil.preventConstructor(this, Traversal, "TraversalΪ�����࣬����ʵ��find������");
            this.mapModel = param1;
            this.maxTry = param2;
            return;
        }// end function

        protected function closeNote(param1:TraversalNote) : void
        {
            param1.noteOpen = false;
            param1.noteClosed = true;
            return;
        }// end function

        public function find(param1:Point, param2:Point) : Array
        {
            return null;
        }// end function

        protected function getPath(param1:Point, param2:TraversalNote) : Array
        {
            var path:Array = [];
            var point:Point = param2.point;
            while (!mapModel.reachEnd(point, param1))
            {
                
                path.unshift(point);
                param2 = param2.parent;
                point = param2.point;
            }
            path.unshift(param1);
            return path;
        }// end function

        protected function openNote(param1:Point, param2:int, param3:int, param4:TraversalNote) : void
        {
            var _loc_5:* = new TraversalNote();
			_loc_5.point = param1;
            _loc_5.score = param2;
            _loc_5.cost = param3;
            _loc_5.parent = param4;
            mapModel.setNode(param1, _loc_5);
            this.openList.push(_loc_5);
            return;
        }// end function

    }
}
